<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form id="form1" runat="server" style="border: 2px solid #2881FB;margin: 10px 20px;">
    <object clsid="{454C18E2-8B7D-43C6-8C17-B1825B49D7DE}" id="captrue" width="556" height="423"
            type="application/x-itst-activex" style="z-index: 10;position: relative;">

    </object>
    <div style="text-align: center;width: 556px; height: 45px;display: flex;flex-direction: row;margin-top: -3px;border-top: 2px solid #2881FB;">
        <div style="border-right: 2px solid #2881FB;" onclick="startCam()">&nbsp;相机
        </div>
        <div onclick="save()" style="border-right: 2px solid #2881FB;">&nbsp;保存
        </div>
        <div onclick="startCard()" style="border-right: 2px solid #2881FB;">&nbsp;证件
        </div>
        <div onclick="ParaSetPIN_onclick()"
             class="setting_btn_unchecked">&nbsp;设置
        </div>

    </div>

    <!--<img src="images/cam.png" style="cursor: pointer;width: 40px;margin-right: 30px;" onclick="startCam();"/>-->
    <!--<img src="images/scan.png" style="cursor: pointer;width: 40px;" onclick="startScan();"/>-->
</form>
<img id="im" src=""/>
<script>
    function startCam() {
        captrue.bSetMode(0);
        captrue.bStopPlay();
        captrue.bStartPlay2(0);
        captrue.bSetMode(0);

    }
    function startCard(){
        captrue.bStopPlay();
        captrue.bStartPlay();
        captrue.bSetMode(3);
    }
    function save() {
        captrue.bSaveJPG('d:\\',"JPG");
        var base64  = captrue.sGetBase64();
        document.getElementById("im").src="data:image/png;base64,"+base64;
    }
</script>
</body>
</html>